package com.qzsoft.system.common;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author gbx
 */
@Component
public class ConstantUtils implements InitializingBean {
    @Value("${avatar.localhostAddr}")
    private String localhostAddr;

    @Value("${avatar.uploadMappingPath}")
    private String uploadMappingPath;

    @Value("${avatar.uploadPath}")
    private String uploadPath;

    @Value("${avatar.defaultHeadUrl}")
    private String defaultHeadUrl;

    @Value("${avatar.avatarCollectionCode}")
    private String avatarCollectionCode;

    @Value("${avatar.avatarItemCode}")
    private String  avatarItemCode;

    public static String LOCAL_HOST_ADDR;
    public static String UPLOAD_MAPPING_PATH;
    public static String UPLOAD_PATH;
    public static String DEFAULT_HEAD_URL;
    public static String AVATAR_C_CODE;
    public static String AVATAR_I_CODE;
    @Override
    public void afterPropertiesSet() throws Exception {
        LOCAL_HOST_ADDR = localhostAddr;
        UPLOAD_MAPPING_PATH = uploadMappingPath;
        UPLOAD_PATH = uploadPath;
        DEFAULT_HEAD_URL = defaultHeadUrl;
        AVATAR_C_CODE = avatarCollectionCode;
        AVATAR_I_CODE = avatarItemCode;
    }
}
